<template>
  <div>
      <div class="table-main">
        <!-- 表格 -->
        <v-table
          title="督办信息列表"
          v-if="tableMainHeight>0"
          :table-columns="tableColumns"
          :table-data="tableData"
          :loading="loading"
          :is-index="true"
          :isDynamicCol="false"
          ref="table"
          :maxHeight="tableMainHeight">
        </v-table>
      </div>
  </div>
</template>

<script>
  import { queryProcessRecord } from '@/api/collect/collect'
   import VTable from '@/components/VTable/index'
    export default {
        name: "urgeInfo",
        components:{
          VTable
        },
      props: {
        dialogVisible: {
          type: Boolean,
          default: false
        },
        superviseOrderNum:{
          type:String,
          default:""
        }
      },
      watch:{
        dialogVisible:{
          handler(newVal, oldVal) {
            if(newVal){
              console.log("监测指===",newVal)
              this.getData()
            }
          },
          deep: true,
          immediate: true
        }
      },
      data(){
        return{
          tableColumns:[
            {
              prop: 'nodeName',
              label: '节点名称',
              minWidth: '150',
              slotname: 'nodeName',
              options: {}
            },
            {
              prop: 'createDeptName',
              label: '处理部门',
              minWidth: '150',
              slotname: 'createDeptName',
              options: {}
            },
            {
              prop: 'createUserName',
              label: '处理人',
              minWidth: '150',
              slotname: 'createUserName',
              options: {}
            },
            {
              prop: 'createTime',
              label: '处理时间',
              minWidth: '150',
              slotname: 'createTime',
              options: {}
            },
            {
              prop: 'description',
              label: '描述',
              minWidth: '150',
              slotname: 'description',
              options: {}
            },
            {
              prop: 'remark',
              label: '备注',
              minWidth: '150',
              slotname: 'remark',
              options: {}
            }
            ],
          tableData:[],
          loading:false,
          tableMainHeight: 0,
        }
        },
      methods:{
        getData(){
          console.log("获取督办值",this.superviseOrderNum)
          // this.superviseOrderNum = "E20231129100002";
          if(this.superviseOrderNum){
            queryProcessRecord({superviseOrderNum:this.superviseOrderNum}).then(res=>{
              if(res.code==200){
                this.tableData= res.data
              }
            })
          }else {
            this.tableData= []
          }
        }
      },
      mounted(){
        this.tableMainHeight = document.getElementsByClassName('table-main')[0].clientHeight - 44 //减去顶部按钮列表的高度
      }
    }
</script>

<style scoped>

</style>
